package hero;

import java.awt.Graphics;
import java.awt.image.BufferedImage;

import bullets.HeroBullet;

public class UltimateSkill extends HeroBullet{
	/**
	 * 
	 */
	private static final long serialVersionUID = 7330187159139651135L;
	private static BufferedImage[] images;
	static {
		images=new BufferedImage[4];
		images[0]=readImage("src/images/UltimateSkill1.png");
		images[1]=readImage("src/images/UltimateSkill2.png");
		images[2]=readImage("src/images/UltimateSkill3.png");
		images[3]=readImage("src/images/UltimateSkill4.png");
	}
	public UltimateSkill(int x,int y,int flag){//子弹的初始化
		this.x=x;
		this.y=y;
		this.width=128;
		this.height=128;
		this.heroFlag=flag;
		speed=10;
	}
	public void step() {
		y-=speed;
	}
	public BufferedImage getImage() {
		if(isLife()) {
			return images[index-1];
		}else if(isDead()){
			this.status=this.remove;
		}
		return null;
	}
	//由于子弹越界是向上的，所以要重写大招越界方法
	public boolean OutOfBounds() {
		return this.y<-this.height;
	}
	@Override
	public void paintImage(Graphics g) {
		if(status==live) {
			g.drawImage(images[index], x, y,null);
		}
		
	}
}
